package com.example.week2_intent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class SubActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_sub);
	}
	
	public void click(View v){
		if(v instanceof TextView){
			TextView tv = (TextView) v;
			String alpabet = (String) tv.getText();
			Intent data = new Intent();
			data.putExtra("alpabet", alpabet);
			setResult(888,data);
			finish();
		}
	}
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_sub, menu);
		return true;
	}

}
